home *** CD-ROM | disk | FTP | other *** search
/ Aminet 19 / Aminet 19 (1997)(GTI - Schatztruhe)[!][Jun 1997].iso / Aminet / dev / amos / KyzerAMOScode.lha / Map.AMOS / Map.amosSourceCode
Encoding:
AMOS Source Code  |  1992-09-03  |  2.0 KB  |  75 lines

  1. ' "map" plasma by kyzer/csg, original acorn version by jan vibe
  2. ' familiar to london underground users...
  3. ' note: the key to the size of the joints is the size of dx() and dy()...
  4. Set Buffer 64
  5. SIZE=4
  6. Dim C(15,3) : For A=0 To 15 : For B=1 To 3 : C(A,B)=255 : Next B : Next A
  7. Degree : Hide 
  8. Screen Open 0,320,256,16,0 : Curs Off : Flash Off : Cls 0
  9. A=$FFF : Palette 0,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A
  10. '
  11. Dim X(1,2000),Y(1,2000)
  12. Dim D(1,2000),F(1,2000)
  13. Dim DX(8),DY(8)
  14. '
  15. For N=0 To 7
  16.    Read A,B
  17.    DX(N)=SIZE*A
  18.    DY(N)=SIZE*B
  19. Next 
  20. P1=0 : P2=1 : C1=1
  21. X(P1,C1)=160
  22. Y(P1,C1)=128
  23. D(P1,C1)=Rnd(8)-1
  24. F(P1,C1)=Rnd(15)
  25. Repeat 
  26.    Swap P1,P2
  27.    C2=C1 : C1=0
  28.    Add F,1,1 To 15 : Ink F
  29.    For N=1 To C2
  30.       PX=X(P2,N) : PY=Y(P2,N)
  31.       PD=D(P2,N) : PF=F(P2,N)
  32.       '
  33.       DP=(Rnd(3)+6+PD) mod 8
  34.       If Extension_12_0470(PX+DX(DP),PY+DY(DP))=0
  35.          XP=PX+DX(DP) : YP=PY+DY(DP) : Extension_12_04F0 PX,PY To XP,YP
  36.          Inc C1 : X(P1,C1)=XP : Y(P1,C1)=YP : D(P1,C1)=DP : F(P1,C1)=FP
  37.       End If 
  38.       If Rnd(1)>0.5
  39.          For A=0 To 2
  40.             DP=Rnd(8)
  41.             If Extension_12_0470(PX+DX(DP),PY+DY(DP))=0
  42.                XP=PX+DX(DP) : YP=PY+DY(DP) : Extension_12_04F0 PX,PY To XP,YP
  43.                Inc C1 : X(P1,C1)=XP : Y(P1,C1)=YP : D(P1,C1)=DP : F(P1,C1)=FP
  44.                Exit 
  45.             End If 
  46.          Next A
  47.       End If 
  48.    Next 
  49. Until C1=0
  50. '
  51. ' now it is drawn, we can colour cycle it! 
  52. '
  53. Repeat 
  54.    Wait Vbl 
  55.    For N=14 To 1 Step -1
  56.       For M=1 To 3
  57.          C(N+1,M)=C(N,M)
  58.       Next 
  59.    Next 
  60.    For M=1 To 3
  61.       C(0,M)=C(0,M)+Rnd(13)+15
  62.       C(1,M)=127*(Sin(C(0,M))+1)
  63.    Next 
  64.    For N=1 To 15
  65.       R=C(N,1)/16
  66.       G=C(N,2)/16
  67.       B=C(N,3)/16
  68.       Colour N,(R*$100)+(G*$10)+(B*$1)
  69.    Rem note the colour is actually calculated as 24-bit, but is scaled down 
  70.    Rem only because AMOS can't handle an AGA palette. It would be nice if I 
  71.    Rem could type "AGA Colour N,C(N,1)*$10000+C(N,2)*$100+C(N,3)"...
  72.    Next 
  73. Until Inkey$<>""
  74. '
  75. Data -1,1,0,1,1,1,1,0,1,-1,0,-1,-1,-1,-1,0